package com.nciae.controller;


import com.nciae.po.Score;
import com.nciae.service.IScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Guoliyu
 * @since 2022-03-31
 */
@RestController
@RequestMapping("/score")
public class ScoreController {

    @Autowired
    private IScoreService scoreService;

    @PostMapping
    public ResponseEntity<Boolean> add(@RequestBody Score score) {
        System.out.println(score);
        scoreService.addScore(score);
        return ResponseEntity.ok(true);
    }

}
